package com.spzx.JUC2.test4;

public class ChangeNumber extends Number {

    public static void main(String[] args) {

        Number num = new Number();
        new Thread(()->{
            for (int i = 1; i < 11; i++) {
                try {
                    num.add();
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
            }
        }).start();

        new Thread(()->{
            for (int i = 1; i < 11; i++) {
                try {
                    num.minus();
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
            }
        }).start();
    }
}
